package org.xgluo.services;

/**
 * 声明式事务:XML格式配置
 * xml中配置事务通知和切点实现声明式事务管理
 */

import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.DefaultTransactionDefinition;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionTemplate;

@Service
public class UserDemoServiceStatment {

    @Autowired
    JdbcTemplate jdbcTemplate;

    public void updateUserInfo(){

        jdbcTemplate.update("update infouser set name='123' where iduser='123' ");

    }

    public void updateUserInfo1(){
        jdbcTemplate.update("update infouser set name='124' where iduser='124' ");
        int i= 2/0;
    }

}
